package com.promise.jokerdream.response.pc

import kotlinx.serialization.Serializable
import kotlinx.serialization.SerialName

@Serializable
data class QuerySkillEnhanceResponse(
    override val result: Int,
    override val msg: String = "",
    // 等级
    val level: String = "",
    // 技能列表
    val storage: List<Storage> = emptyList(),
): BasePCResponse {
    override fun getDescription(): String {
        return msg
    }
    
    /**
     * 转换等级格式：0 -> "0-0", 29 -> "5-5"
     */
    fun convertLevel(): String {
        val levelInt = level.toIntOrNull() ?: 0
        val first = (levelInt + 1) / 6
        val second = levelInt % 6
        return "$first-$second"
    }
}

@Serializable
data class Storage(
    // 技能栏等级
    @SerialName("storageLevel")
    val storageLevel: String = "",
    // 技能ID
    @SerialName("skillId")
    val skillId: String = "",
    // 技能名称
    @SerialName("skillName")
    val skillName: String = ""
)
